/**
 * zmn文章模块-文章编辑
 * 文件命名格式：zmn.模块.表/功能.jas
 * @author duanzuocai
 * @since 2018/10/18
 */
layui.define(['form', 'layedit', 'laydate'], function (exports) {
    var $ = layui.$;
    var form = layui.form;
    var layer = layui.layer;
    var layedit = layui.layedit;
    var laydate = layui.laydate;

    form.render(null, "zmn-pointserv-form");

    zmnPage.laySelectLinkage2(form, {
        "cityId": "/common/area/listChilds.action",
        "pointId": "/common/point/listChilds.action"
    }, "provinceId", "cityId", "pointId");

    // 提交
    form.on('submit(zmn-pointserv-form-submit)', function (obj) {
        var openId = layer.open({type: 3});
        var data = obj.field;
        var url = "/point/servitem/add.action";

        $.ajax({
            async: false,
            type: "POST", url: url,
            contentType: "application/json", dataType: "json", data: JSON.stringify(data),
            success: function (json) {
                layer.close(openId);
                layer.msg(json.message);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                layer.close(openId);
            }
        })
        return false;
    });

    //对外暴露的接口
    exports('art_point_serv_detail', {});
});